﻿using iTextSharp.text;
using iTextSharp.text.pdf;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace QG.FrontDesk.com.Models
{
    public class UnicodeFontFactory : FontFactoryImp
    {
        private static readonly string arialFontPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts),
            "arialuni.ttf");//arial unicode MS是完整的unicode字型。
        private static readonly string kaiuPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts),
            "KAIU.TTF");//标楷体
        private static readonly string simsunPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts),
            "simsun.ttc,1");//新宋体
        private static readonly string msyhPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts),
            "msyh.ttf");//微软雅黑

        public override Font GetFont(string fontname, string encoding, bool embedded, float size, int style, BaseColor color,
            bool cached)
        {
            //采用微软雅黑
            BaseFont baseFont = BaseFont.CreateFont(simsunPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
            return new Font(baseFont, size, style, color);
        }
    }
}